package decorator.inner;

import java.io.*;

/**
 * @author: zhouyang
 * @descrpition:
 * @time: 2019-05-24 19:41
 */
public class Main {
    public static void main(String[] args) {
        int c;
        try {
            //相对路径是相对于src
            File file = new File("src/decorator/inner/test.txt");
            if(file.exists()){
                FileInputStream fis = new FileInputStream(file);
                InputStream in = new UpperCaseInputStream(new BufferedInputStream(fis));
                //InputStream in = new UpperCaseInputStream(fis);
                while ((c=in.read())>=0){
                    System.out.print((char)c);
                }
            }else{
                System.out.println("file is not exists");
            }

        } catch (FileNotFoundException e) {
            e.printStackTrace();
        } catch (IOException e) {
            e.printStackTrace();
        }
    }
}
